<?php

namespace App\Console\Commands;

use App\Jobs\ArchiveLaneOpenLogs;
use App\Jobs\ArchiveParkOutLogs;
use App\Models\Common\Constant;
use Illuminate\Console\Command;

class ArchiveData extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'archive-data';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '归档数据';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        // 开闸记录
        ArchiveLaneOpenLogs::dispatch()->onQueue(Constant::QUEUE_MIXED);
        // 出场车辆
        ArchiveParkOutLogs::dispatch()->onQueue(Constant::QUEUE_MIXED);

        return 1;
    }
}
